home *** CD-ROM | disk | FTP | other *** search
- on mouseUp
- set the trails of sprite 19 to 1
- if field "A" > 4 then
- put 4 into field "A"
- end if
- if field "A" < -4 then
- put -4 into field "A"
- end if
- if field "B" > 10 then
- put 10 into field "B"
- end if
- if field "B" < 0 then
- put 1 into field "B"
- end if
- set x0 to the locH of sprite 12 + 1
- set y0 to the locV of sprite 12
- set period to float(field "B")
- if the hilite of cast "Degrees" then
- set phase to float(field "C" * PI / 180.0)
- else
- set phase to field "C"
- end if
- if the foreColor of sprite 19 >= 6 then
- set the foreColor of sprite 19 to 0
- else
- set the foreColor of sprite 19 to the foreColor of sprite 19 + 1
- end if
- repeat with n = 0 to 240
- set the locH of sprite 19 to (2.39999999999999991 * n) + x0
- if the hilite of cast "Sine" then
- set the locV of sprite 19 to y0 - (field "A" * 50.0 * float(sin((float(period * n * 3.0) * PI / 180.0) + phase)))
- end if
- if the hilite of cast "Cosine" then
- set the locV of sprite 19 to y0 - (field "A" * 50.0 * float(cos((float(period * n * 3.0) * PI / 180.0) + phase)))
- end if
- if the hilite of cast "Tangent" then
- set the locV of sprite 19 to y0 - (field "A" * 50.0 * float(tan((float(period * n * 3.0) * PI / 180.0) + phase)))
- end if
- updateStage()
- end repeat
- end
-
- on mouseDown
- button()
- end
-